<!doctype html>
<html>
<!-- 已废弃 并整合到licai_hqlc页面中 -->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <script type="text/javascript" src="./script/jquery.min.js"></script>
    <script type="text/javascript" src="./script/doT.min.js"></script>
    <script type="text/javascript" src="./script/base.js"></script>
    <script type="text/javascript" src="./script/api.js"></script>
</head>

<body>
    <header class="aui-bar aui-bar-nav">
        <div class="aui-title">理财</div>
    </header>
    <div class="aui-bar-nav-d"></div>

    <style>
        body {
            background: #fff;
        }
    </style>
    <ul class="licai-nav">
        <li tapmode onclick="licai_hqlc()">活期理财</li>
        <li class="active">智能理财</li>
        <li tapmode onclick="licai_yzzq()">优质债券</li>
    </ul>

    <div id="list"></div>
    <script type="text/template" id="template">
        <ul class="licai-znlc">
            {{~it:value:index}}
            <li class="aui-row">
                <div class="licai-znlc-t">
                    <span class="green">锁定周期</span>
                    <span class="red">智能选投</span>
                </div>
                <div class="aui-col-xs-4">
                    <h2>
                  {{=value.rate}}%
                  {{? value.is_hot==1}}
                  <img src="image/licai-znlc.png">
                  {{??}}{{?}}
              </h2>
                    <p>预期年化收益</p>
                </div>
                <div class="aui-col-xs-4">
                    {{=value.time_limit}}个月
                    <p>投资期限</p>
                </div>
                <div class="aui-col-xs-4 buy">
                    <a tapmode onclick="znlc_buy({{=value.id}})">立即抢购</a>
                    <p>剩余{{=value.borrow_amount}}元</p>
                </div>
                {{? value.is_rec==1}}
                <i>推荐</i>
                {{??}}{{?}}
            </li>
            <!-- <li class="aui-row">
                <div class="licai-znlc-t">
                </div>
                <div class="aui-col-xs-4">
                    <h2>
                  12.40%
                  <img src="image/licai-znlc.png">
              </h2>
                    <p>预期年化收益</p>
                </div>
                <div class="aui-col-xs-4">
                    12个月
                    <p>投资期限</p>
                </div>
                <div class="aui-col-xs-4">
                    <a>立即抢购</a>
                    <p>剩余80,000,00元</p>
                </div>
                <i>推荐</i>
            </li>
            <li class="aui-row off">
                <div class="licai-znlc-t">
                </div>
                <div class="aui-col-xs-4">
                    <h2>
                  12.40%
              </h2>
                    <p>预期年化收益</p>
                </div>
                <div class="aui-col-xs-4">
                    12个月
                    <p>投资期限</p>
                </div>
                <div class="aui-col-xs-4 buy">
                    <a>立即抢购</a>
                    <p>剩余80,000,00元</p>
                </div>
                <div class="aui-col-xs-4 img">
                    <img src="image/licai-znlc-off-1.png">
                </div>
            </li> -->
            {{~}}
        </ul>
    </script>

    <!-- <ul class="licai-znlc">
    <li class="aui-row">
        <div class="licai-znlc-t">
            <span class="green">锁定周期</span>
            <span class="red">智能选投</span>
        </div>
        <div class="aui-col-xs-4">
            <h2>
                12.40%
                <img src="image/licai-znlc.png">
            </h2>
            <p>预期年化收益</p>
        </div>
        <div class="aui-col-xs-4">
            12个月
            <p>投资期限</p>
        </div>
        <div class="aui-col-xs-4 buy">
            <a tapmode onclick="znlc_buy()">立即抢购</a>
            <p>剩余80,000,00元</p>
        </div>
    </li>
    <li class="aui-row">
        <div class="licai-znlc-t">
        </div>
        <div class="aui-col-xs-4">
            <h2>
                12.40%
                <img src="image/licai-znlc.png">
            </h2>
            <p>预期年化收益</p>
        </div>
        <div class="aui-col-xs-4">
            12个月
            <p>投资期限</p>
        </div>
        <div class="aui-col-xs-4">
            <a>立即抢购</a>
            <p>剩余80,000,00元</p>
        </div>
        <i>推荐</i>
    </li>
    <li class="aui-row off">
        <div class="licai-znlc-t">
        </div>
        <div class="aui-col-xs-4">
            <h2>
                12.40%
            </h2>
            <p>预期年化收益</p>
        </div>
        <div class="aui-col-xs-4">
            12个月
            <p>投资期限</p>
        </div>
        <div class="aui-col-xs-4 buy">
            <a>立即抢购</a>
            <p>剩余80,000,00元</p>
        </div>
        <div class="aui-col-xs-4 img">
            <img src="image/licai-znlc-off-1.png">
        </div>
    </li>
</ul> -->



    <div class="foot-t"></div>
    <!-- <ul class="foot">
        <li tapmode>
            <img src="image/foot-1.png" onclick="index()">
            <p onclick="index()">首页</p>
        </li>
        <li class="active" tapmode>
            <img src="image/foot-2-h.png" onclick="licai_hqlc()">
            <p onclick="licai_hqlc()">理财</p>
        </li>
        <li tapmode>
            <img src="image/foot-3.png" onclick="user()">
            <p onclick="user()">我的</p>
        </li>
        <li tapmode>
            <img src="image/foot-4.png" onclick="more()">
            <p onclick="more()">更多</p>
        </li>
    </ul> -->
</body>
<script type="text/javascript">
    apiready = function() {
        load_list();
        down_refresh();
    }

    function index() {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'index',
            url: './index.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    };

    function licai_hqlc() {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'licai_hqlc',
            url: './licai_hqlc.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    };

    function licai_yzzq() {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'licai_yzzq',
            url: './licai_yzzq.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    };

    function user() {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'user',
            url: './user.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    };

    function more() {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'more',
            url: './more.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    };

    function znlc_buy(id) {
        var delay = 0;
        if (api.systemType != 'ios') {
            // delay = 300;
        }
        api.openWin({
            name: 'znlc_buy',
            url: './znlc_buy.html',
            pageParam: {
                id: id
            }
        });

    };

    function closeWin() {
        api.closeWin({});
    }

    function load_list(n) {

        api.showProgress({
            style: 'default',
            animationType: 'fade',
            title: '努力加载中...',
            text: '先喝杯茶...',
            modal: false
        });
        if (n) {
            page += 1;
        } else {
            page = 1;
        }
        api.ajax({
            url: webAddress + '/index.php?ctl=app_deal&act=deal_list&page=' + page,
            method: 'get',

        }, function(ret, err) {
            if (ret) {
                // alert(JSON.stringify(ret));
                if (ret.status == 0) {
                    alert(ret.info);
                } else if (ret.status == 1) {

                    for (var i = 0; i < ret.licai.list.length; i++) {
                        ret.licai.list[i].borrow_amount = outputmoney(ret.licai.list[i].borrow_amount);
                    }
                    updateList(ret.licai.list, ret.licai.min_money);
                }
                api.refreshHeaderLoadDone();
                api.hideProgress();
            }
        });

    }

    // 下拉刷新
    function down_refresh() {

        api.setRefreshHeaderInfo({
            visible: true,
            // loadingImg: 'widget://image/refresh.png',
            bgColor: '#ccc',
            textColor: '#fff',
            textDown: '下拉刷新...',
            textUp: '松开刷新...',
            showTime: true
        }, function(ret, err) {
            page = 1;
            load_list();
        });
    }

    function updateList(data, num) {

        var template = $api.byId('template');
        var dotFn = doT.template(template.innerHTML);
        var html = dotFn(data);
        var list = $api.byId('list');
        $api.html(list, html);
        // document.getElementById('num3').innerHTML = outputmoney(num).substr(0, outputmoney(num).length-3)+'元起投';
    }
</script>

</html>
